package com.annvcit.imagewrite;

import java.io.InputStream;
import java.util.Properties;

/**
 * @author hqthai01
 * Jan 22, 2015
 */
public class PropertyLoader {
	private String resource ;
	
	public PropertyLoader(String resource){
		this.resource = resource;
	}
	
	public String getResource(){
		return this.resource;
	}
	
	public void setResource(String resource){
		this.resource = resource;
	}
	
	public String getProperty(String key){
		try {
			InputStream is = PropertyLoader.class.getResourceAsStream(resource);
			Properties pro = new Properties();
			pro.load(is);
			return pro.getProperty(key);
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	}
}
